<?php
include "constants.php";

if (isset($_GET['target'])){
	header('Content-Description: File Transfer');
	header('Content-Type: text/plain');
	header('Content-Disposition: attachment; filename="'.basename(ACH_FILES."/".$_GET['target']).'"');
	header('Content-Transfer-Encoding: binary');
	header('Connection: Keep-Alive');
	header('Expires: 0');
	header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
	header('Pragma: public');
	header('Content-Length: ' . filesize(ACH_FILES."/".$_GET['target']));
	readfile(ACH_FILES."/".$_GET['target']);
}
else {
	echo "Invalid parameter.";
}
?>